/**
 * The New BSD license is used for the ForD2 RPG (Multi-Layered Framework for
 * Authoring Dungeons and Dragons Based Role Playing Games).
 * Components to provide the largest
 * amount of freedom for developers that want to base their application on this
 * product.
 *
 * Copyright (c) 2007, ForD2 RPG Systems A.S.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * - Neither the name of ForD2 RPG Systems A.S. nor the names of its
 *   contributors may be used to endorse or promote products derived from this
 *   software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

package framework.core.character;

import framework.persistence.GenericPersistentable;
import framework.runtime.Time;
import java.util.ArrayList;
import java.util.List;

/**
 * This class represents an existent spells that can be caster.
 * @author <B>Marcos Tadeu Silva</B>
 *         e-mail: <I>zero.ufal@gmail.com</I>, 08/31/2007.
 * @version 0.1
 * @since first
 */
public class Spell extends GenericPersistentable {
    
    // constants ------------------------------------------------------------
    
    // properties -----------------------------------------------------------
    
    public String name;
    public String description;
    
    private String range;
    private String target;
    
    private boolean spellResistence;
    
    private int innateLevel;
    private int xpCost;
    
    private BookLevel   bookLevel;
    private SpellSchool school;
    private SpellKind   kind;
    private Time        duration;
    
    private List<SpellDomain> domains;
    private List<SpellDescriptor> descriptors;
    private List<SpellComponent> components;
    private List<Save> resistencesChecks;
    private List<CasterLevel> casterLevels;
    
    // static  --------------------------------------------------------------
    
    // constructors ---------------------------------------------------------
    
    /**
     * Creates a new Instance of Spell initializing:
     * - components; - casterLevels; - descriptors; - domains; 
     * - resistencesChecks;
     */
    public Spell() {
        domains = new ArrayList<SpellDomain>();
        
        descriptors  = new ArrayList<SpellDescriptor>();
        components   = new ArrayList<SpellComponent>();
        casterLevels = new ArrayList<CasterLevel>();
        
        resistencesChecks = new ArrayList<Save>();
    }
    
    public Spell(final String name, final String description) {
        this();
        this.name = name;
        this.description = description;
    }
    
    // private methods ------------------------------------------------------
    
    // public methods -------------------------------------------------------
    
    // x override -----------------------------------------------------------
    
    // y implementation -----------------------------------------------------
    
    // z inner class --------------------------------------------------------
    
    public BookLevel getBookLevel() {
        return bookLevel;
    }
    
    public List<CasterLevel> getCasterLevels() {
        return casterLevels;
    }
    
    public List<SpellComponent> getComponents() {
        return components;
    }
    
    public List<SpellDescriptor> getDescriptors() {
        return descriptors;
    }
    
    public List<SpellDomain> getDomains() {
        return domains;
    }
    
    public Time getDuration() {
        return duration;
    }
    
    public int getInnateLevel() {
        return innateLevel;
    }
    
    public SpellKind getKind() {
        return kind;
    }
    
    public String getRange() {
        return range;
    }
    
    public List<Save> getResistencesChecks() {
        return resistencesChecks;
    }
    
    public SpellSchool getSchool() {
        return school;
    }
    
    public String getTarget() {
        return target;
    }
    
    public int getXpCost() {
        return xpCost;
    }
    
    public boolean isSpellResistence() {
        return spellResistence;
    }
    
    public void setBookLevel(final BookLevel bookLevel) {
        this.bookLevel = bookLevel;
    }
    
    public void setCasterLevels(final List<CasterLevel> casterLevels) {
        this.casterLevels = casterLevels;
    }
    
    public void setComponents(final List<SpellComponent> components) {
        this.components = components;
    }
    
    public void setDescriptors(final List<SpellDescriptor> descriptors) {
        this.descriptors = descriptors;
    }
    
    public void setDomains(final List<SpellDomain> domains) {
        this.domains = domains;
    }
    
    public void setDuration(final Time duration) {
        this.duration = duration;
    }
    
    public void setInnateLevel(final int innateLevel) {
        this.innateLevel = innateLevel;
    }
    
    public void setKind(final SpellKind kind) {
        this.kind = kind;
    }
    
    public void setRange(final String range) {
        this.range = range;
    }
    
    public void setResistencesChecks(final List<Save> resistencesChecks) {
        this.resistencesChecks = resistencesChecks;
    }
    
    public void setSchool(final SpellSchool school) {
        this.school = school;
    }
    
    public void setSpellResistence(final boolean spellResistence) {
        this.spellResistence = spellResistence;
    }
    
    public void setTarget(final String target) {
        this.target = target;
    }
    
    public void setXpCost(final int xpCost) {
        this.xpCost = xpCost;
    }
    
}
